<%@page import="wt.httpgw.URLFactory"%>
<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<%
	String path = request.getContextPath();
	request.setCharacterEncoding("utf-8");

	URLFactory urlfactory;
	String baseHref = "";
	String url = "";
	urlfactory = new URLFactory();
	baseHref = urlfactory.getBaseHREF();
%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>查询部件属性</title>
<style>
.button {
    font-size: 15px;
}
#s2 {
	display:none;
}
#s4 {
	display:none;
}
</style>
</head>
<body>
<table border="0" align="center" width="400px">
	<span id="s1" align="center">
	<span style="margin-left: 15px;font-size:15px;">请点击查询按钮查询部件属性: <input class="s3" type="button"  value="查询" class="button"/></span>
	</span><br>
	<span id="s4" align="center">
	<span style="margin-left: 15px;font-size:15px;">正在查询中,请等候......</span>
	</span><br>
	<span id="s2"  align="center">
	<span style="margin-left: 15px;font-size:15px;">请点击下载按钮下载部件属性的表格: <input type="button" onclick="Click()" value="下载" class="button"/></span>
	</span>
</table> 
</body>
<script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.js"></script>
<script type="text/javascript">

function Click(){
   <!-- window.location.href="http://plm-uat.tianma.cn/Windchill/temp/PartAttributeExcel/partAttribute.xls";-->
	window.location.href="<%=path%>/temp/PartAttributeExcel/partAttribute.xls";
}


	   $(".s3").click(function () {
		   $("#s1").css('display','none'); 
		   $("#s4").css('display','block');
        //触发ajax事件
        $.ajax({
            <!--url:"http://plm-uat.tianma.cn/Windchill/app/PartAttribute/writeToXls",-->
			url:"<%=path%>/app/PartAttribute/writeToXls",
            type:"get",
            success:function (data) {
				$("#s4").css('display','none'); 
				$("#s2").css('display','block'); 
            }
        })
    });
	

 </script>
</html>